package cn.yi.newsys.utils ;

import javax.mail.Session;

public class Test {
	public static void main(String[] args) throws Exception{
		//1. 得到session
        Session session = MailUtils.createSession("smtp.qq.com", "zhu532570043@qq.com", "luvctgxssavjbhah");
        //2. 创建邮件对象
        Mail mail = new Mail("zhu532570043@qq.com","1181819582@qq.com","测试邮件2", "你是个憨逼");
        mail.addToAddress("562320873@qq.com");
        //创建两个附件对象
        //AttachBean ab1 = new AttachBean(new File("F:/Lebron.jpeg"), "小美女.jpg");
        //AttachBean ab2 = new AttachBean(new File("F:/big.jpg"), "衣服.jpg");
        // 添加到mail中
        //mail.addAttach(ab1);
        //mail.addAttach(ab2);
        //3. 发送
        MailUtils.send(session, mail);
        System.out.println("发送成功");
	}
}
